https://leetcode.cn/problems/longest-substring-without-repeating-characters/
//滑动数组
class Solution {
public:
    int lengthOfLongestSubstring(string s) {
        int left = 0, right = 0;
        int len = 0;
        int hash[128] = {0};
        while (right < s.size()) {
            hash[s[right]]++;
            while (hash[s[right]]>1)
            {
                hash[s[left++]]--;
            }
            len = max(len, right - left+1);
            right++;
        }
        return len;
};